#include "sweety_App.h"
#include <iostream>

namespace SW
{
	SwApp* SwApp::m_pSharedApplication = nullptr;

	SwApp::SwApp()
	{
		assert(!m_pSharedApplication);
		m_pSharedApplication = this;
	}

	SwApp::~SwApp()
	{
		m_pSharedApplication = nullptr;
	}

	SwApp* SwApp::GetInstance()
	{
		return m_pSharedApplication;
	}

	bool SwApp::Init()
	{
		return true;
	}

	int SwApp::Run()
	{
		// InitInstance runs the App's initialization code
		if (Init())
		{
			// Dispatch the window messages
			MessageLoop();
		}
		else
		{
			std::cout << "InitInstance failed!  Terminating program!" << std::endl;
			return -1;
		}

		return 0;
	}

}
